﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Function.aspx.cs" Inherits="famails.BackEnd.page.Function" MasterPageFile="~/Master.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <style>
        #ContentPlaceHolder1_checkisDefault {
            height: 20px;
            width: 20px;
            margin-top: -3px;
            margin-left: 10px;
        }
    </style>
<div style="width:100%;padding:10px;">

    <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="border: 1px solid #333; padding: 0px; margin-bottom: 10px;">
        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="padding: 10px 20px; background: #000; color: #fff; font-size: 18px; font-weight: bold; position: relative;">
            Quản lý chức năng
        </div>
        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="height: auto; padding: 10px;">
            <asp:Panel Visible="false" ID="pnError" runat="server">
                <div class="error-box round">
                    <asp:Label ID="lblError" runat="server" Text=""></asp:Label>
                </div>
            </asp:Panel>
            <asp:Panel Visible="false" ID="pnSuccess" runat="server">
                <div class="confirmation-box round">
                    <asp:Label ID="lblSuccess" runat="server" Text=""></asp:Label>
                </div>
            </asp:Panel>
        </div>
        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="height: auto; padding: 0px;">
            <div class="col-md-6 col-xs-12 col-sm-6 col-lg-6" style="height: auto; padding: 10px;">
                <fieldset>
                    <label for="simple-input" style="font-weight: bolder; text-transform: none">
                        Tên chức năng</label>
                    <asp:TextBox ID="txtfunctionName" runat="server" CssClass="form-control" Style="border: 1px solid #333; border-radius: 0px;"></asp:TextBox>
                </fieldset>
            </div>
            <div class="col-md-6 col-xs-12 col-sm-6 col-lg-6" style="height: auto; padding: 10px;">
                <fieldset>
                    <label for="simple-input" style="font-weight: bolder; text-transform: none">
                        Giá</label>
                    <asp:TextBox ID="txtcode" runat="server" CssClass="form-control" Style="border: 1px solid #333; border-radius: 0px;"></asp:TextBox>
                </fieldset>
            </div>
        </div>
        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="height: auto; padding: 10px;">
            <fieldset>
                <label for="simple-input" style="font-weight: bolder; text-transform: none">
                    Diễn giải</label>
                <asp:TextBox ID="txtdescription" TextMode="MultiLine" runat="server" CssClass="form-control" Style="border: 1px solid #333; border-radius: 0px;"></asp:TextBox>
            </fieldset>
        </div>
        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="height: auto; padding: 0px;">
            <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6" style="height: auto; padding: 10px;">
                <fieldset>
                    <label for="full-width-input" style="float: left;">Mặc định</label>
                    <asp:CheckBox ID="checkisDefault" Style="float: left;" runat="server" />
                </fieldset>
            </div>
            <div class="col-md-6 col-xs-6 col-sm-6 col-lg-6" style="height: auto; padding: 10px;">
                <fieldset>
                        <button id="Button1" runat="server" class="btn" style="float:left;margin-right:10px;background:#333;color:#fff;text-align:center;padding:6px 15px;border-radius:0px;" 
                            onserverclick="btnSave_Click">
                            <i style="margin-right:10px;" class="fa fa-upload"></i> Cập nhật
                        </button>
                </fieldset>
            </div>
        </div>
    </div>

    <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="border: 1px solid #333; padding: 0px; margin-bottom: 10px;">
        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="padding: 10px 20px; background: #000; color: #fff; font-size: 18px; font-weight: bold; position: relative;">
            Danh sách chức năng
        </div>
        <asp:HiddenField runat="server" ID="hdfId" />
        <div class="col-md-12 col-xs-12 col-sm-12 col-lg-12" style="height: auto; padding: 10px;">
                <fieldset>
                    <div class=" table-responsive">
                    <table class="table table-striped table-bordered table-hover" id="dataTables-example">
                        <thead>
                            <tr>
                                <th>Tên chức năng</th>
                                <th>Đơn giá</th>
                                <th>Mặc định</th>
                                <th style="width:100px;">Tùy chỉnh</th>
                            </tr>
                        </thead>
                        <tbody>
                    <asp:Repeater ID="dtfunction" runat="server">
                         <ItemTemplate>
                            <tr>
                                <td>
                                    <asp:Label ID="lblAttr" runat="server" Text='<%# Eval("functionName") %>'></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="lblGmail" runat="server" Text='<%# Eval("cost") %>'></asp:Label>
                                </td>
                                <td>
                                    <asp:Label ID="lblYahooMail" runat="server" Text='<%# Eval("isDefault") %>'></asp:Label>
                                </td>
                                <td style="text-align:center;">
                                    <asp:ImageButton ID="btnEdit" runat="server" ImageUrl="../resource/images/edit-validated-icon.png"
                                        CommandArgument='<%# Eval("functionId") %>' OnClick="btnEdit_Click" />
                                    <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="../resource/images/Delete-icon.png"
                                        CommandArgument='<%# Eval("functionId") %>'
                                        OnClientClick="return confirmDelete('Bạn có chắc rằng sẽ xóa thuộc tính này không ?')"
                                        OnClick="btnDelete_Click2" />
                                </td>
                            </tr>     
                         </ItemTemplate>
                     </asp:Repeater>
                        </tbody>
                    </table>
                        </div>
            </fieldset>
        </div>

    </div>
</div>
<script>
    $(document).ready(function () {
        $('#dataTables-example').dataTable();
    });
</script>
</asp:Content>

